home *** CD-ROM | disk | FTP | other *** search
/ QRZ! Ham Radio 8 / QRZ Ham Radio Callsign Database - Volume 8.iso / pc / files / t_unix / j109lxa4.tar / dirutil.h < prev    next >
C/C++ Source or Header  |  1994-06-04  |  2KB  |  72 lines

  1. #ifndef _DIRUTIL_H
  2. #define _DIRUTIL_H
  3.  
  4. #ifndef _GLOBAL_H
  5. #include "global.h"
  6. #endif
  7.  
  8. #ifdef UNIX
  9. #include <time.h>
  10.  
  11. struct ffblk
  12. {
  13.     char ff_name[256];        /* current filename result */
  14.     struct tm ff_ftime;        /* modify date/time */
  15.     long ff_fsize;        /* file size */
  16.     int ff_attrib;        /* DOS-style attributes (ugh) */
  17. #ifdef GLOB_INTERNAL        /* ...only visible to internals... */
  18.     char *ff_pfx;        /* prefix for found patterns */
  19.     char *ff_pat;        /* pattern for the current level */
  20.     DIR *ff_dir;        /* directory scan for the current level */
  21.     struct dirent *ff_cur;    /* current path component */
  22.     long ff_sattr;        /* selected attributes */
  23. #else
  24.     long youdontseethis[5];
  25. #endif
  26. };
  27.  
  28. #define FA_NORMAL    0    /* anything except the following: */
  29. #define FA_SYSTEM    1    /* device node or unreadable file */
  30. #define FA_HIDDEN    2    /* dot-files */
  31. #define FA_DIREC    4    /* directory */
  32. #define FA_RDONLY    8    /* read-only file */
  33.  
  34. extern int findfirst __ARGS((char *pat, struct ffblk *ff, int attr));
  35. extern int findnext __ARGS((struct ffblk *ff));
  36. extern void findlast __ARGS((struct ffblk *ff));
  37.  
  38. #endif
  39.  
  40. struct cur_dirs {
  41. #ifndef UNIX
  42.            int drv;
  43.            char * curdir[27];
  44. #endif
  45.            char * dir;                
  46. } ;
  47.  
  48. /* In dirutil.c */
  49. FILE *dir __ARGS((char *path,int full));
  50. int filedir __ARGS((char *name,int times,char *ret_str));
  51. int getdir __ARGS((char *path,int full,FILE *file));
  52. void undosify __ARGS((char *s));
  53. char * make_dir_path(int count,char *arg,char* curdir);         
  54. char * make_fname(char * curdir, char * fname);
  55. char * init_dirs(struct cur_dirs * dirs);
  56. void free_dirs(struct cur_dirs * dirs);
  57. int dir_ok(char * path,struct cur_dirs * dirs);
  58. int dircmd __ARGS((int argc,char *argv[],void *p));
  59.  
  60.  
  61. /* In pathname.c: */
  62. char *pathname __ARGS((char *cd,char *path));
  63.  
  64. /* In pc.c: */
  65. char *Tmpnam __ARGS((char *name));
  66.  
  67. /* In bmutil.c */
  68. long fsize __ARGS((char *name));
  69.  
  70. #endif /* _DIRUTIL_H */
  71.  
  72.